package com.woniuxy.base.service.impl;


import com.woniuxy.base.mapper.BaseMaterialRecordMapper;
import com.woniuxy.base.model.entity.BaseMaterialRecord;
import com.woniuxy.base.service.BaseMaterialRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class BaseMaterialRecordServiceImpl implements BaseMaterialRecordService {
    @Resource
    private BaseMaterialRecordMapper recordMapper;
    @Override
    public void add(BaseMaterialRecord materialRecord) {
        recordMapper.insert(materialRecord);
    }

    @Override
    public List<BaseMaterialRecord> detail(Integer materialId) {
        Map<String,Object> condition = new HashMap<>();
        condition.put("material_id", materialId);
        return recordMapper.selectByMap(condition);
    }
}
